package stockscreener.persistencia;

import java.util.List;

import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import stockscreener.negocio.Acao;
import stockscreener.negocio.Empresa;
import stockscreener.util.StockScreenerApplicationContext;

public class AcaoDAO extends HibernateDaoSupport {

	public List<Acao> obtemPorSigla(String sigla) {
		HibernateTemplate ht = getHibernateTemplate();
		return ht.find("From Acao where sigla = \'" + sigla + "\'");
	}

	public void salva(Acao acao) {

		HibernateTemplate ht = getHibernateTemplate();
		ht.saveOrUpdate(acao);
	}
	
	public static AcaoDAO get() {
		return (AcaoDAO) StockScreenerApplicationContext.getBean(AcaoDAO.class);
	}

}
